<?php
$cid = $_SESSION['cid'];
$cartInfo = $soap->call ($session_id, 'cart.info', $cid);
// echo print_r($cartInfo);
$items = $cartInfo['items'];
$num_items = sizeof($items);
echo <<< HERE
			<table rules="cols" border="2" cellpadding="10">
				<thead>
					<tr>
						<th width="150"><u>Product Name</u></th>
						<th width="50"><u>Price</u></th>
						<th width="50"><u>Qty</u></th>
						<th width="150"><u>Total Price</u></th>
					</tr>
				</thead>
				
HERE;
echo 			"<tbody style=\"margin-top:10px\">";
echo				"<tr><td colspan=\"4\">&nbsp;</td></tr>";
$total = 0;
for ($i = 0; $i < $num_items; $i++) {
$pid = $items[$i]['product_id'];
$product = $soap->call ($session_id, 'catalog_product.info', $pid);
echo 				"<tr>";
echo					"<td>".$items[$i]['name']."</td>";
echo					"<td>$".number_format($product['price'], 2, '.', ',')."</td>";
echo					"<td>".$items[$i]['qty']."</td>";
echo					"<td>$".number_format($product['price']*$items[$i]['qty'], 2, '.', ',')."</td>";
$total += number_format($product['price']*$items[$i]['qty'], 2, '.', ',');
echo				"<tr>";
}
echo				"<tr><td colspan=\"4\">&nbsp;</td></tr>";
$_SESSION['total'] = $total;
echo			"</tbody>";
echo 			"<tfoot>";
echo				"<tr>";
echo					"<td><b>Total</b></td>";
echo					"<td colspan=\"2\"></td>";
echo					"<td align=\"right\"><b>$$total</b></td>";
echo				"</tr>";
echo			"</tfoot>";
echo		"</table>";
?>